<?php
//初始跳转到登陆页面
Route::get('/',function()
{
	return Redirect::to('cms/login');
});
//设置配置页面
Route::get('install', function()
{
	return Redirect::to('config/guidance');
});

Route::group(['prefix'=>'config'],function()
{
	//展示配置数据库连接页面
	Route::get('guidance','SetEnvironmentController@showView');
	//设置数据库连接
	Route::post('setEnvironment','SetEnvironmentController@setEnvironment');
});



Route::group(['prefix'=>'cms'],function()
{
	//展示登陆页面
	Route::get('login','LoginController@showView');

	//登陆信息检测
	Route::post('loginCheck','LoginController@loginCheck');

	//检测是否已经登陆
	Route::group(['before'=>'auth'],function()
	{
		//模板管理
		Route::group(['prefix'=>'model'],function()
		{
			//添加模板
			Route::post('add','ModelController@addModel');
			//删除模板
			Route::delete('delete','ModelController@deleteModel');
		});
	});
});